//
//  MainViewController.m
//  SAILIN
//
//  Created by 崔国冠 on 2018/10/18.
//  Copyright © 2018年 赛麟. All rights reserved.
//

#import "MainViewController.h"
#import "NINavigationController.h"
#import "NITabBar.h"
#import "SetPinPasswordViewController.h"
@interface MainViewController ()

@end

@implementation MainViewController{
    
    NITabBar *tabBar;
    
    
}
#pragma mark - Life Cycle
- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated{
    
    [super viewWillAppear:animated];
    
    [self initUI];
    

}

#pragma mark - UI
- (void)initUI{
    
    tabBar = [NITabBar NiTabbar];
    [self.view addSubview:tabBar];
    tabBar.delegate = self;
    [tabBar setSelectIndex:0];
    [tabBar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.mas_equalTo(self.view);
        make.bottom.mas_equalTo(self.view).offset(-BOTTOM_CONSTRAINT);
        make.height.mas_equalTo(self.tabBar.frame.size.height);
    }];

}

#pragma mark - NITabBarDelegate
- (void)onTabSelect:(NSInteger)index{
    self.selectedIndex = index;
}
#pragma mark - 跳转
- (void)toSettingPinPasswordViewController{
    
    [self.navigationController pushViewController:[SetPinPasswordViewController new] animated:NO];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


@end
